package duoxiancheng;

import java.text.SimpleDateFormat;
import java.util.Date;

public class BlockSleep{
    public static void main(String[] args) throws InterruptedException {
        Date endTime = new Date(System.currentTimeMillis()+1000*10);//结束时间，现在时间+10s
        long end = endTime.getTime();
        while (true){
            Thread.sleep(1000);
            System.out.println(new SimpleDateFormat("mm:ss").format(endTime));
            endTime = new Date(endTime.getTime()-1000);
            if(end-10000>endTime.getTime()){
                break;
            }
        }
    }
}
